#include "server.h"

int adpm_server_get_base_info(unsigned long name_hash, struct adpm_file_base_info *bi)
{
  static int shi = 0;
  if(!shi)bi->id = 0;
  else bi->id = 1;
  ++shi;
  return 0;
}
int adpm_server_update(long old_ver, long new_ver, struct adpm_client_file *f)
{
  return 0;
}
int adpm_server_create(char *name, struct adpm_file_base_info *bi, long size){
  bi->version = 1;
  bi->id = 1;
  bi->size = (size | (ADPM_REGION_SIZE - 1)) + 1;
  return 0;
}

int adpm_server_get_page(struct adpm_client_file *          f, struct adpm_page *pg, long pgoff)
{
  int *p ,st, i;
  p = adpm_page_to_vir_addr(pg, f->sbi);
  st = pgoff<<10;
  for(i = 0; i < 1024; i++){
    *(p + i) = st + i;
  }
  return 0;
}



